#ifndef LIBUSBCONTROL_H
#define LIBUSBCONTROL_H

#include "USBBase.h"
#include "libusb.h"
#include "define/func_define.h"

/// 通过wireshark查询读取端点
#define HID_ENDPOINT_IN 0x81
#define HID_PROTO_LEN   19


class LibUSBControl:public USBBase
{
public:
    LibUSBControl();

    virtual  bool ReadBuff() override;
    virtual  int OpenPort(int ,int ) override;
    virtual  int CloseDevice() override;
    virtual  int Send(const char*) override;

private:
    int openDevice(int ,int );
    int init_libusb();

    void thread_callback();
    void registerInterrupt();
};

#endif // LIBUSBCONTROL_H
